﻿using Volo.Abp.EventBus;

namespace SharedModule
{
    /// <summary>
    /// 日志消息
    /// </summary>
    [EventName("SMS.SentLog")] //Optional event name
    public class EventLogData
    {
        public EventCreatePostDto EventCreatePostDto { get; set; }

        public EventLogData()
        {
        }

        public EventLogData(EventCreatePostDto eventCreatePostDto)
        {
            EventCreatePostDto = eventCreatePostDto;
        }
    }

    [EventName("SMS.EventLog")]
    public class EventCreatePostDto
    {
        public StationTypeEnum StationType { get; set; }

        public string StationName { get; set; }

        public int UserId { get; set; }

        public EventLevelEnum EventLevel { get; set; }

        public EventSubTypeEnum EventSubType { get; set; }

        public string Des { get; set; }

        public EventKeyInfoDto KeyInfos { get; set; }

        public long DesTemplateId { get; set; }

        public DateTime? CreateTime { get; set; }

        public long ErrCode { get; set; }

        public string ZhCn { get; set; }

        public string ZhHk { get; set; }

        public string EnUs { get; set; }
    }

    public enum StationTypeEnum
    {
        SttUnspecified = 0,
        SttUnknown = -1,

        /// <summary>
        /// 判图工作站
        /// </summary>
        SttIps = 1,

        /// <summary>
        /// 扫描控制服务
        /// </summary>
        SttScs = 2,

        /// <summary>
        /// 重建服务
        /// </summary>
        SttRcc = 3,

        /// <summary>
        /// 识别服务
        /// </summary>
        SttRcg = 4,

        /// <summary>
        /// 系统管理服务
        /// </summary>
        SttSms = 5,

        /// <summary>
        /// 存储服务
        /// </summary>
        SttRcs = 6,

        /// <summary>
        /// 存储服务
        /// </summary>
        SttCss = 7,

        /// <summary>
        /// 系统管理站
        /// </summary>
        SttVue = 8,

        /// <summary>
        /// 设备管理站
        /// </summary>
        SttOpt = 9,

        /// <summary>
        /// 维护管理站
        /// </summary>
        SttMta = 10,

        /// <summary>
        ///预检管理站
        /// </summary>
        SttPck = 11,

        /// <summary>
        ///开检工作站
        /// </summary>
        SttCbs = 12,

        /// <summary>
        ///判图服务
        /// </summary>
        SttIpss = 13,

        /// <summary>
        ///判图服务
        /// </summary>
        SttIpc = 14,

        /// <summary>
        ///确认工作站
        /// </summary>
        SttCfs = 15,

        /// <summary>
        ///设备管理服务
        /// </summary>
        SttDms = 16,

        /// <summary>
        ///系统管理站
        /// </summary>
        SttSmsc = 17,

        /// <summary>
        ///设备管理站
        /// </summary>
        SttDmsc = 18,

        /// <summary>
        /// 预检服务
        /// </summary>
        SttPiss = 19,

        /// <summary>
        /// 预检管理站
        /// </summary>
        SttPisc = 20
    }

    public class EventKeyInfoDto
    {
        public List<KeyInfo> KeyInfos { get; set; } = new List<KeyInfo>();
    }

    public class KeyInfo
    {
        public int Index { get; set; }

        public bool NeedTranslation { get; set; }

        public string Params { get; set; }

        public List<int> ParamsList { get; set; } = new List<int>();

        public long ParamId { get; set; }

        /// <summary>
        /// Indicates the identification number, the default user group needs to be translated, and the permission needs to be translated
        ///1-- User group; 2- User; 3-- Permissions
        /// </summary>
        public TableMarkEnum TableMark { get; set; }
    }

    public enum EventLevelEnum
    {
        Deadly = 1,       //致命
        Error = 2,        //错误
        Warning = 3,      //警告
        Info = 4,         //信息
        Debug = 5,        //调试
    }

    /// <summary>
    ///
    /// </summary>
    public enum EventSubTypeEnum
    {
        Login = 1,                 //登入
        Logout = 2,                //登出
        Correction = 3,            //校正
        Reconstruction = 4,        //重建
        Identify = 5,              //识别
        Establish = 6,             //新建
        Delete = 7,                //删除
        Modify = 8,                //修改
        Query = 9,                 //查询
        Data_collection = 10,      //数采
        Export = 11,               //导出
        Device_error = 12,         //故障
        Recovery = 13,             //恢复-设备
        Maintain = 14,             //维护
        Diag = 15,                 //诊断
        Reset = 16,                //复位
        Check = 17,                //校验
        Sys_err = 18,              //异常
        Sys_recovery = 19,         //恢复-系统
        Judge_image = 20,          //判图--代码隐藏
        Over_flow = 21,            //溢出--代码隐藏
        Scanning = 22,             //扫描
        Print = 23,                //打印
        Import = 24,               //导入
        BoxSend = 25,              //箱体送出
        BoxBack = 26,              //箱体退回
        Twicercs = 27,             //再重建
        Twicercg = 28              //再识别
    }

    public enum TableMarkEnum
    {
        UserGroup = 1,       //User group
        User = 2,            //User
        Permissions = 3      //Permissions
    }
}